/**
 * 元组：就是类型和数量确定的数组
 */
export function testTuple() {
  let tuple1: [number, string] = [1, 'test']
  console.log("testTuple number", tuple1[0])
  console.log("testTuple string", tuple1[1])

  // 元组的元素是可选
  let tuple2: [number?, string?] = []

  let onlyReadTuple: readonly [number?, string?] = []
  // onlyReadTuple[0] = 1 编译报错，因为元组是只读的

  // 元组的剩余参数
  let leaveTuple: [number, ...string[]] = [1, '', '' ,'']

}

